package com.bookstore.mapper;

import com.bookstore.entity.BookCar;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author :Cofe
 * @Date 2022/4/21 21:40
 */
@Mapper
public interface BookCarMapper {
    //添加购物车
    void insertBookCar(@Param("bid")int bid,@Param("book_name") String book_name, @Param("book_balance")double book_balance,@Param("user_uid")int user_uid,@Param("book_pic")String book_pic,@Param("book_membalance")double book_membalance);
    //查看当前用户购物车
    List<BookCar> findcarbyuid(int user_uid);
    //移除购买的所有图书
    void daleteAllinfo(@Param("user_uid")int user_uid);
    //通过订单编号移除
    Integer deleteByBuy(@Param("buy_id")int buy_Id);
    //查看该订单编号的图书信息
    BookCar findcarbyid(@Param("buy_id")int buy_id);
    //通过页数查询购物车信息
    List<BookCar> selectByPage(@Param("begin") int begin, @Param("size") int size,@Param("user_uid")int user_uid);
    //分页条件查询
    List<BookCar> selectByPageAndCondition(@Param("begin") int begin,@Param("size") int size,@Param("BookCar") BookCar bookCar);
    //记录总数据
    Integer selectTotalCount();
    //根据条件查询总记录数
    Integer selectTotalCountByCondition(@Param("BookCar")BookCar bookCar);
}
